//
//  XMGArenaViewController.m
//  小码哥彩票
//
//  Created by xiaomage on 15/6/26.
//  Copyright (c) 2015年 xiaomage. All rights reserved.
//

#import "XMGArenaViewController.h"

@interface XMGArenaViewController ()

@end

@implementation XMGArenaViewController

- (void)loadView
{
    UIImageView *imageView = [[UIImageView alloc] initWithFrame:[UIScreen mainScreen].bounds];
    
    imageView.userInteractionEnabled = YES;
    
    imageView.image = [UIImage imageNamed:@"NLArenaBackground"];
    
    self.view = imageView;
}

- (void)viewDidLoad {
    
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    UISegmentedControl *seg = [[UISegmentedControl alloc ]initWithItems:@[@"手机",@"电脑"]];
    seg.width += 40;
    
    [seg setBackgroundImage:[UIImage imageNamed:@"CPArenaSegmentBG"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
    [seg setBackgroundImage:[UIImage imageNamed:@"CPArenaSengmentSelectedBG"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
    
    seg.selectedSegmentIndex = 0;
    
    seg.tintColor = [UIColor colorWithRed:0 / 255.0 green:142 / 255.0 blue:143 / 255.0 alpha:1];
    
    NSMutableDictionary *dict = [NSMutableDictionary dictionary];
    
    dict[NSForegroundColorAttributeName] = [UIColor whiteColor];
    [seg setTitleTextAttributes:dict forState:UIControlStateSelected];
    
    self.navigationItem.titleView = seg;
    
}
@end
